/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.tom.social.analyzer.agent;

import jade.core.AID;
import jade.core.Agent;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import pl.tom.social.analyzer.agent.behaviour.UpdateTaskBarBehaviour;

/**
 *
 * @author Tom
 */
public class TaskBarAgent extends Agent {
	private static final Logger logger = Logger.getLogger(TaskBarAgent.class);
	private static int counter = 0;
	private AID receiver;

	public TaskBarAgent(AID receiver) {
		this.receiver = receiver;
	}

	/**
	 * @return the counter
	 */
	public static int getNumberOfRunningAgents() {
		return counter;
	}
	
	@Override
	protected void setup() {
		// Printout a hello message
		logger.log(Level.INFO, "TaskBar-agent " + getAID().getName() + " starting");

		//Register behaviours
		addBehaviour(new UpdateTaskBarBehaviour(receiver));
	}

	@Override
	protected void takeDown() {
		// Printout a dismissal message
		logger.log(Level.INFO, "TaskBar-agent " + getAID().getName() + " terminating");
	}
}
